package com.rsk.datasource.sharding.rules;

import java.util.Arrays;

import io.shardingjdbc.core.api.config.MasterSlaveRuleConfiguration;
import io.shardingjdbc.core.api.config.TableRuleConfiguration;
import io.shardingjdbc.core.api.config.strategy.InlineShardingStrategyConfiguration;

public class MasterSlaveRules {
	
	/**
	 * 读写策略
	 * @return
	 */
	public static MasterSlaveRuleConfiguration masterSlaveRulesConfig() {
		// 配置user表规则
		MasterSlaveRuleConfiguration configuration = new MasterSlaveRuleConfiguration();
		configuration.setName("dba1");
		configuration.setMasterDataSourceName("ms1");;
		configuration.setSlaveDataSourceNames(Arrays.asList("sl1"));
		return configuration;
	}
}
